package com.ziyun.erp.modules.order.vo;

import com.utility.JsonUtils;
import org.apache.commons.lang.StringUtils;

import java.util.List;

/**
 * 工厂VO
 * 
 * @author Zhang.Peng
 */
public class FactoryInfoVO {

	/** 工厂id */
	private Integer id;

	/** 是否自营 */
	private Boolean self;

	/** 小B参考的工厂id */
	private Boolean sellRefer;

	/** 工厂名字 */
	private String factoryName;

	/** 地址 */
	private String address;

	/** 联系人 */
	private String contacts;

	/** 联系方式 */
	private String contactWay;

	/** QQ */
	private String qq;

	/** 图片url */
	private String url;

	/** 描述 */
	private String desc;

	/** 工厂产品利润上浮系数 */
	private double factoryProductProfitRatio;

	private String factoryProductNumber;

	/** 运费模板id */
	private Integer freightTemplateId;

	/** 是否收藏 */
	private Boolean collectFlag;

	/** 利润系数阶梯价 */
	private List<LadderProfit> ladderProfits;

	public static FactoryInfoVO valueOf(Integer id, String factoryName, String address, String contacts,
			String contactWay, String url, String desc, double factoryProductProfitRatio, String factoryProductNumber) {
		FactoryInfoVO factoryInfoVO = new FactoryInfoVO();
		factoryInfoVO.id = id;
		factoryInfoVO.factoryName = factoryName;
		factoryInfoVO.address = address;
		factoryInfoVO.contacts = contacts;
		factoryInfoVO.contactWay = contactWay;
		// factoryInfoVO.qq = qq;
		factoryInfoVO.url = url;
		factoryInfoVO.desc = desc;
		factoryInfoVO.factoryProductProfitRatio = factoryProductProfitRatio;
		factoryInfoVO.factoryProductNumber = factoryProductNumber;
		return factoryInfoVO;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getFactoryName() {
		return factoryName;
	}

	public void setFactoryName(String factoryName) {
		this.factoryName = factoryName;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getContacts() {
		return contacts;
	}

	public void setContacts(String contacts) {
		this.contacts = contacts;
	}

	public String getContactWay() {
		return contactWay;
	}

	public void setContactWay(String contactWay) {
		this.contactWay = contactWay;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public Boolean getSelf() {
		return self;
	}

	public void setSelf(Boolean self) {
		this.self = self;
	}

	public Boolean getSellRefer() {
		return sellRefer;
	}

	public void setSellRefer(Boolean sellRefer) {
		this.sellRefer = sellRefer;
	}

	public double getFactoryProductProfitRatio() {
		return factoryProductProfitRatio;
	}

	public void setFactoryProductProfitRatio(double factoryProductProfitRatio) {
		this.factoryProductProfitRatio = factoryProductProfitRatio;
	}

	public String getFactoryProductNumber() {
		return factoryProductNumber;
	}

	public void setFactoryProductNumber(String factoryProductNumber) {
		this.factoryProductNumber = factoryProductNumber;
	}

	public Integer getFreightTemplateId() {
		return freightTemplateId;
	}

	public void setFreightTemplateId(Integer freightTemplateId) {
		this.freightTemplateId = freightTemplateId;
	}

	public void setCollectFlag(Boolean collectFlag) {
		this.collectFlag = collectFlag;
	}

	public List<LadderProfit> getLadderProfits() {
		return ladderProfits;
	}

	public void setLadderProfits(String ladderProfits) {
		if (StringUtils.isNotBlank(ladderProfits)) {
			this.ladderProfits = JsonUtils.string2Collection(ladderProfits, List.class, LadderProfit.class);
		}
	}

	public Boolean getCollectFlag() {
		return collectFlag;
	}

	public void setLadderProfits(List<LadderProfit> ladderProfits) {
		this.ladderProfits = ladderProfits;
	}

}
